Property partner is a property crowdfunding site…

Data source: open house (July 2017).

pp_resale <- pp_resale %>% 
  mutate(`Transaction (£)` = `Unit Count` * `Unit Price`) %>% 
  mutate(Year = year(`Last Transaction`), 
         Month = month(`Last Transaction`),
         Week = week(`Last Transaction`), 
         Day = day(`Last Transaction`)) %>% 
  mutate(`Transaction size (£)` = case_when(`Transaction (£)` < 100 ~ "£0-£99",
                                            `Transaction (£)` < 500 ~ "£100-£499",
                                            `Transaction (£)` < 5000 ~ "£500-£5,000",
                                            `Transaction (£)` < 50000 ~ "£5,000-£50,000",
                                            `Transaction (£)` >= 50000 ~ "£50,000+") %>% 
           factor(levels = c("£0-£99", "£100-£499", "£500-£5,000", "£5,000-£50,000", "50,000+")))
plot_resales_over_time <- pp_resale %>% 
  mutate(`Last Transaction` = floor_date(`Last Transaction`, unit = "month")) %>% 
  group_by(`Last Transaction`, `Transaction type`) %>% 
  summarise(`Transaction (£)` = sum(`Transaction (£)`)) %>% 
  ggplot(aes(x = `Last Transaction`, y = `Transaction (£)`, fill = `Transaction type`)) +
  geom_bar(stat = "identity") +
  scale_y_continuous(labels = comma) + 
  labs(title = "Property Partner Transactions") + 
  theme_minimal() 

ggplotly(plot_resales_over_time)
plot_resales_over_time_by_size <- pp_resale %>% 
  mutate(`Last Transaction` = floor_date(`Last Transaction`, unit = "month")) %>% 
  group_by(`Last Transaction`, `Transaction size (£)`) %>% 
  summarise(`Transaction (£)` = sum(`Transaction (£)`)) %>% 
  ggplot(aes(x = `Last Transaction`, y = `Transaction (£)`, fill = `Transaction size (£)`)) +
  geom_bar(stat = "identity") +
  scale_y_continuous(labels = comma) + 
  labs(title = "Property Partner Transactions; by Transaction size (£)",
       caption = "Facetted by Transaction size (£), aggregated by month") + 
  theme_minimal() +
  facet_wrap(~`Transaction size (£)`)

ggplotly(plot_resales_over_time_by_size)
pp_resale %>% 
  ggplot(aes(x = `Transaction (£)`, y = factor(Year), fill = `Transaction size (£)`)) +
  geom_joy() +
  facet_wrap(~`Transaction size (£)`, scales = "free_x") +
  ylab("Year") +
  labs(title = "Distribution of transactions",
       subtitle = "Facetted by Transaction size (£), over time") +
  theme_minimal() +
    theme(legend.position = "none")
## Picking joint bandwidth of 4.49
## Picking joint bandwidth of 17.7
## Picking joint bandwidth of 82.7
## Picking joint bandwidth of 978

pp_resale %>% 
  ggplot(aes(x = factor(Year), y = `Transaction (£)`, fill = `Transaction size (£)`, colour = `Transaction size (£)`)) +
  geom_violin(draw_quantiles = c(0.25, 0.5, 0.75), alpha = 0.2) +
  geom_jitter(width = 0.3, alpha = 0.01, data = sample_n(pp_resale, size = round(nrow(pp_resale)/10, digits = 0))) +
  facet_wrap(~`Transaction size (£)`, scales = "free") +
  xlab("Year") +
  labs(title = "Distribution of transactions",
       subtitle = "Facetted by Transaction size (£), over time",
       caption = "Plotted points represent a 10% sample of the data") +
  theme_minimal() +
    theme(legend.position = "none")